/**
 * \file kernel/arch/x86/arch.c
 * \author Davide Gessa
 * \date 10-19-09
 */
#include <main.h>
#include <syscall.h>
#include "archinc.h"
#include <arch.h>
#include <debug.h>

/**
 * Callback delle syscall
 */
extern void syscallisr();


/**
 * Inizializza l'architettura
 */
void arch_init()
{
	DEBUGP("arch_init()\n");
	
	ARCH[0] = 'x';
	ARCH[1] = '8';
	ARCH[2] = '6';
	ARCH[3] = '\0';
	
	cpu_vendor_name(CPU_VENDOR);
	
	gdt_install();
	idt_install();
	isrs_install();
	irq_install();	
	timer_init();
	clock_init();
	
    idt_set_gate(SYSCALL_INT, (unsigned)syscallisr, 0x08, 0x8E);
    
	asm("sti");
}
